package com.weblog.weblogapi.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.weblog.weblogapi.dao.mapper.ClassifyMapper;
import com.weblog.weblogapi.dao.pojo.Classify;
import com.weblog.weblogapi.service.ClassifyService;
import com.weblog.weblogapi.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ClassifyServiceImpl implements ClassifyService {
    @Autowired
    private ClassifyMapper classifyMapper;
    @Override
    public Result getAllSort() {
        LambdaQueryWrapper<Classify> queryWrapper=new LambdaQueryWrapper<Classify>();
        List<Classify> classifyList = classifyMapper.selectList(queryWrapper);
        return Result.success(classifyList);
    }

    @Override
    public Classify findClassifyById(int sortId) {
        LambdaQueryWrapper<Classify> queryWrapper=new LambdaQueryWrapper<>();
        Classify classify=classifyMapper.selectById(sortId);
        return classify;
    }
}
